import {createRouter, createWebHashHistory} from 'vue-router';
import Home from "../views/Home.vue";
import Login from "../views/Login.vue";

//路由
let routes = [
    {
        path: "/",
        redirect: '/home'
    },
    { path: "/login", name: "login",meta:{title:"登录",top:"0"},component: Login,
    },
    { path: "/home", name: "home",meta:{title:"个人页",top:"0"},component: Home,
    },
]

// Vue-router新版本中，需要使用createRouter来创建路由
export default  createRouter({
    // 指定路由的模式,此处使用的是hash模式
    history: createWebHashHistory(),
    routes
})